<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>提醒时间管理</title> 
<#include '/frame/version.html'> 
<#include '/frame/manage/include_css.html'> 
<#include '/frame/manage/include_js.html'> 
<#include '/frame/taglib.html'>
</head>
<body id="nv_member" class="pg_CURMODULE">
	<#assign current='menu_notice_time'>
	<div id="wp" class="wp">
		<#include "/include/header.html"/>
		<div class="contentmanage">
			<div class="developer">
				<div class="tableContent">
					<#include "/include/left.html"/> <#include "/include/wxtop.html"/>
					<div class="content">
					<div class="cLineB">
				        <h4 class="left">
				        	提醒时间管理
				        </h4>
				        <div class="clr">
				        </div>
						<div class="msgWrap">
						
						<div class="cLine">
						<div class="pageNavigator left">
								已放款未交凭证人员数量：${count} 人
							</div>
							<div class="pageNavigator right">
                                   <a href="javascript:void(0)" id="add" title="新增" class="btnGrayS">
									<img width="16" src="${basePath}/images/add.png" class="vm">新增
								   </a>
                            </div>
						</div>
							<table class="ListProduct Shallow_border_color" border="0"
								cellSpacing="0" cellPadding="0" width="100%">
								<thead>
									<tr>
										<th>编号</th>
										<th>创建时间</th>
										<th>提醒时间(月)</th>
										<th>状态</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<#if page?exists> <#list page.recordList as bean>
									<tr>
										<td valign="middle" align="center">${page.pernum*(page.currentPage-1)+bean_index+1}</td>
										<td>${bean.createTime?string('yyyy-MM-dd HH:mm:ss')}</td>
										<td>${bean.noticeTime}个月</td>
										<td><#if bean.status=='0'>禁用<#else>启用</#if></td>
										<td class="norightborder">
										<a href="javascript:void(0);" onclick="del('${bean.id}')">删除</a>
										<#assign status='0'>
										<a href="javascript:void(0);" onclick="updateStatus('${bean.id}')"><#if bean.status=='0'><#assign status='1'>启用<#else>禁用</#if></a>
										
										</td>
									</tr>
									</#list> </#if>
								</tbody>
							</table>
						</div>

						<#assign formUrl="${basePath}/admin/notice/index?">
						 <#include "/include/pagination.html">
					</div>
					<div class="clr"></div>
				</div>
			</div>
		</div>
		<!--底部-->
	</div>
	<!--ad start-->
	<!--ad end-->
	</div>
	</div>
	</div>
	<#include "/include/footer.html"/>
	<script>
	function del(id){
		stem.confirm("确认删除吗？","删除",function(){jQuery.ajax({
			type : 'POST',
			url : base + '/admin/notice/edit/2',
			data : {
				"id" : id,
				"token":"${token}"
			},
			success : function(data) {
				if (data.status == "1") {
					window.location.reload();
					return true;
				} else {
					stem.warn(data.msg);
					return false;
				}
			}
		});
		});
	};
	function updateStatus(id){
		$.ajax({
			type : 'POST',
			url : base + '/admin/notice/edit/1',
			data : {
				"id" : id,
				"status":"${status}",
				"token":"${token}",
			},
			success : function(data) {
				if (data.status == "1") {
					window.location.reload();
					return true;
				} else {
					stem.warn(data.msg);
					return false;
				}
			}
		});
	};
	
	$("#add").click(function(){
		stem.confirm(
				"提醒时间：<input id='noticeTime' name='noticeTime' class='px' placeholder='设置几个月后提醒客户' value='' maxlength='3'/>",
				"新增提醒时间", function() {
					var noticeTime = $("#noticeTime").val();
					if(isNaN(noticeTime)){
						stem.warn("非法的录入！");
						return false;
						}
					$.ajax({
						type : 'POST',
						url : base + '/admin/notice/edit/1',
						data : {
							"noticeTime" :noticeTime,
							"token":"${token}"
						},
						success : function(data) {
							if (data.status == "1") {
								window.location.reload();
								return false;
							} else {
								stem.warn(data.msg);
								return false;
							}
						}
					});
				
				});	
	});
			
		
	</script>
</body>
</html>